/*********************************************************
 * Socket with Buffer. Buffer for Read , Buffer for Write
 *
 * created by dirkcai
 *********************************************************/
#ifndef BUFFERSOCKET_H
#define BUFFERSOCKET_H

#include "socket.h"
#include "buffer.h"

#define TEMPLEN 1024

class BufferSocket
{
public:
	BufferSocket( int connfd );
	~BufferSocket();

	int ClearReadBuffer();
	int ClearWriteBuffer();
	int ReadToBuffer();
	int ReadToBufferEx();
	int WriteFromBuffer();
	int WriteFromBufferEx();
	Buffer * GetReadBuffer();
	Buffer * GetWriteBuffer();
	int GetFd();
private:
	Buffer m_tReadBuffer;
	Buffer m_tWriteBuffer;	
	Socket m_tSocket;
};

#endif
